package com.chushouya.order.constants;


import com.general.framework.core.enums.IEnum;
import com.general.framework.core.exception.Ex;

import java.util.Objects;

public enum BizTypeEnum implements IEnum<Integer> {

    //数码回收
    //旧衣回收
    SHUMA(1, "数码回收"),
    JIUYI(2, "旧衣回收"),;

    private Integer value;

    private String desc;

    BizTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static BizTypeEnum get(Integer value) {
        for (BizTypeEnum thisEnum : BizTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum;
            }
        }
        throw Ex.systemError("未定义的枚举[{}]", value);
    }


    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
